package com.yeban.javase.day17.sync;

import java.util.concurrent.TimeUnit;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/31
 */
public class Product implements Runnable{

    private final House house;

    public Product(House house) {
        this.house = house;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            house.store();
            try {
                TimeUnit.MILLISECONDS.sleep(300);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
